From: Alexandre Emsenhuber Date: Fri, 22 Nov 2013 19:36:17 +0000 (+0100) Subject: Only put returnto parameter if needed on the from-http redirect in Special:Userlogin X-Git-Tag: 1.31.0-rc.0~16592^2 X-Git-Url: http://git.cyclocoop.org//%22http:/%22.attribut_html%28%24lesurls%5B%24numero%5D%29.%22/%22?a=commitdiff_plain;h=d27fcb42de130fa6fe95e8dfd37d4d271c637700;p=lhc%2Fweb%2Fwiklou.git Only put returnto parameter if needed on the from-http redirect in Special:Userlogin The default value of the $mReturnTo and $mReturnToQuery member variables is '', even if they were not passed. This means that they would always be present in the redirected URL when accessing Special:Userlogin from HTTP and HTTPS is available. Now the special case '' is changed to null so that they don't appear anymore if not needed. Change-Id: I49a085feaa49d4b2954ff280db241234d2d46258 --- diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index bbe56ecca3..69013b046a 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -172,8 +172,9 @@ class LoginForm extends SpecialPage { if ( $this->mRequest->getProtocol() !== 'https' ) { $title = $this->getFullTitle(); $query = array( - 'returnto' => $this->mReturnTo, - 'returntoquery' => $this->mReturnToQuery, + 'returnto' => $this->mReturnTo !== '' ? $this->mReturnTo : null, + 'returntoquery' => $this->mReturnToQuery !== '' ? + $this->mReturnToQuery : null, 'title' => null, ) + $this->mRequest->getQueryValues(); $url = $title->getFullURL( $query, false, PROTO_HTTPS );